/**
 * Created by Dalyn on 2017/3/14.
 */
import Relay from "react-relay";

export default class GetLoanRecordListMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { getLoanRecordList }`;
    }

    getVariables() {
        return {
            argsInput: {
                pageNum: this.props.pageNum,
                pageSize: this.props.pageSize,
                partyBEnName:this.props.partyBEnName,
                status:this.props.status,
                partyBEnid:this.props.partyBEnid,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on getLoanRecordListPayload {
            data {  
                errorCode
                value
                totalResult
                id
                sumMoney
                sumInterest
                loanRecordList{
                    startTime
                    partyBEnName
                    region
                    money
                    dayRate
                    interest
                    purpose
                    useNo
                    status
                    loanRecordId
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on getLoanRecordListPayload {
                    data {
                        errorCode
                        value
                        totalResult
                        id
                        sumMoney
                        sumInterest
                        loanRecordList{
                           startTime
                           partyBEnName
                            region
                            money
                            dayRate
                            interest
                            purpose
                            useNo
                            status
                            loanRecordId
                        }
                       
                    }
                }
            `]
        }];
    }

}